//
//  QuDanMessageVC.m
//  QuDanOEM
//
//  Created by wmz on 2021/11/6.
//

#import "QuDanMessageVC.h"
#import "HDSearchBar.h"

@interface QuDanMessageVC ()<GNTableViewProtocol>
@property (weak, nonatomic) IBOutlet GNTableView *tableView;
@property (strong, nonatomic) NSMutableArray *dataSoure;
@property (weak, nonatomic) IBOutlet UIView *naviViwq;
@property (strong, nonatomic) HDSearchBar *searchBar;
@end

@implementation QuDanMessageVC

- (void)hd_setupViews{
    self.tableView.GNdelegate = self;
    [self.naviViwq layoutIfNeeded];
    self.searchBar = [[HDSearchBar alloc]initWithFrame:CGRectMake(0, 0, self.naviViwq.bounds.size.width, self.naviViwq.bounds.size.height)];
    self.searchBar.textFieldHeight = 32;
    self.searchBar.backgroundColor = wColor_bg;
    self.searchBar.placeholderColor = wColor_6;
    self.searchBar.placeHolder = @"找谁聊天了";
    self.searchBar.add_constraints(^(MASConstraintMaker * _Nullable make) {
        make.edges.mas_equalTo(0);
    }, self.naviViwq);
}

- (void)hd_bindViewModel{
    self.dataSoure = NSMutableArray.new;
    for (int i = 0; i<10; i++) {
        BaseCellModel *model = [BaseCellModel xib:@"QDMessageCell"];
        [self.dataSoure addObject:model];
    }
}

- (NSArray<id<GNRowModelProtocol>> *)numberOfRowsInGNTableView:(GNTableView *)tableView{
    return self.dataSoure;
}

- (void)GNTableView:(GNTableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath data:(id<GNRowModelProtocol>)rowData{
    [PostWindow windowPushToVC:NSClassFromString(@"QDMessageSystemVC").new currentVC:self hideBottom:YES];
}

- (SAViewControllerNaviType)customNaviType{
    return SAViewControllerNaviTypeHide;
}


@end
